#include <stdio.h>  
#include <string.h>  
  
int main() {  
    char s1[1005], s2[1005];  
    int p1 = 0, p2 = 0;  
    gets(s1);  
    gets(s2);  
    for (; p1 < strlen(s1) && p2 < strlen(s2);) {  
        if (s1[p1] > s2[p2])  
            putchar(s2[p2++]);  
        else  
            putchar(s1[p1++]);  
    }  
    while (p1 < strlen(s1))  
        putchar(s1[p1++]);  
    while (p2 < strlen(s2))  
        putchar(s2[p2++]);  
    putchar('\n');  
    return 0;  
}  